﻿

using Core;
using Core.Factory;
using Core.UIItems;
using Core.UIItems.Finders;
using Core.UIItems.WindowItems;
using NUnit.Framework;

namespace FunctionalTests
{
    [TestFixture]
    public class SampleWhiteTest
    {
        private Window window;
        private Application application;

        [SetUp]
        public void SetUp()
        {
            application = Application.Launch("Munimji.exe");
            window = application.GetWindow("Sample", InitializeOption.NoCache);

        }

        [Test]
        public void ShouldGetWelcomeMessage()
        {
            Button button = window.Get<Button>("btnNext");

            SearchCriteria searchCriteria = SearchCriteria.ByControlType((typeof(Label))).AndByText("");
            Label lbl = (Label)window.Get(searchCriteria);

            button.Click();

            Assert.AreEqual("Hello", lbl.Text);

        }

        [TearDown]
        public void TearDown()
        {
            application.Kill();
        }
    }
}